def print_odd_number(num) :
    i = 0
    while i < num :
        i += 1
        if i % 2 == 0 :
            continue
        print(i)


def while_without_else() :
    i = 1
    while i < 5 :
        print("循环内，i的值是", i)
        i += 1
    print("循环外，i的值是", i)


def while_else() :
    i = 1
    while i < 5 :
        print("循环内，i的值是", i)
        i += 1
    else :
        print("循环外，i的值是", i)

def while_else_break() :
    i = 1
    while i < 5 :
        print("循环内，i的值是", i)
        if i == 2 :
            # 如果循环是因为 break 跳出的，那么就不会去执行 else 代码
            break
        i += 1
    else :
        # 如果循环条件不满足跳出的，那么就会去执行 else 代码
        print("循环外，i的值是", i)

def study_all_week() :
    day = 1
    while day <= 7 :
        answer = input("今天有好好学习吗？")
        if answer != '有' :
            break
        day += 1
    else :
        print("非常棒，你已经坚持了7天连续学习！")


def jiu_jiu_kou_jue() :
    i = 1
    while i <= 9 :
        j = 1
        while j <= i :
            print(j, "*", i, "=", j * i, end=" ")
            j = j + 1
        print()
        i = i + 1


if __name__ == "__main__":
    print_odd_number(10) 
    while_without_else()
    while_else()
    while_else_break()
    study_all_week()
    jiu_jiu_kou_jue()